home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 May / EnigmA AMIGA RUN 07 (1996)(G.R. Edizioni)(IT)[!][issue 1996-05][EARSAN CD VI].iso / rubriche / host-cont / amountns.lha / AMountains / random.c < prev    next >
C/C++ Source or Header  |  1996-01-14  |  199b  |  14 lines

  1. #include <m68881.h>
  2. #include <math.h>
  3.  
  4. double gaussian( void )
  5. {
  6.     double ran;
  7.  
  8.     do {
  9.         ran = drand48();
  10.     } while ( ran == 0.0 );
  11.  
  12.     return sqrt( -2.0 * log( ran ) ) * cos( (2.0 * PI) * drand48() );
  13. }
  14.